import React from 'react';
import { observer } from 'mobx-react';
import {WeaLocaleProvider} from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;
@observer
export default class DoorList extends React.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const{dataSource} = this.props;
            return (
                <div>
                   {dataSource && dataSource.length>0?dataSource.map(function(data,idx){
                       return(
                        <div> 
                            <div className={data.imgclass?data.imgclass:"noimg"} title={data.imgtitle?data.imgtitle:""}></div>
                            <div className="taskdate" _taskid={data.id}>
                                <div className="tname" title={data.name}>
                                <a href="javaScript:void(0);" onClick={()=>this.props.onClick(data.id,idx)}>{data.name}</a>
                                </div>
                                <div className="tcreate">{data.lastname}</div>
                                {data.opttype?<div className="operatediv"><div class="operatebtn" onClick={()=>this.props.execOperation(data.id,data.changetype,idx)} title={data.opttype}>{data.opttype}</div> </div>:""}
                                </div>
                           
                        </div>
                       )
                   },this):<div className="taskTips">{getLabel(83553,'暂无数据')}</div>}
                </div>
            )
    }
};